package cn.com.surker.sale.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 销售合同信息标号调整价
 * </p>
 *
 * @author admin
 * @since 2024-08-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SaleStrengthAdjustPrice implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 公司ID
     */
    @NotNull(message = "请选择公司")
    private Long orgId;

    /**
     * 合同ID
     */
    @NotNull(message = "请选择合同")
    private Long contractId;

    /**
     * 标号ID
     */
    private Long strengthId;

    /**
     * 标号
     */
    @NotNull(message = "请选择强度等级")
    private String strength;

    /**
     * 生效时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date takeTime;

    /**
     * 单价
     */
    @NotNull(message = "请输入单价")
    private Double price;

    /**
     * 含税单价
     */
    @NotNull(message = "请输入含税单价")
    private Double taxPrice;

    /**
     * 标号价格调整类型(信息价浮动类型)
     */
    private Integer type;

    /**
     * 状态(0:启用1：禁用)
     */
    private Integer status;

    /**
     * 备注
     */
    private String remark;
    /**
     * 基准价类型
     */
//    @NotNull(message = "请输入基准价类型")
    private Integer basisPriceType;

    /**
     * 信息价日期(固定调整金额为空)
     */
    private String priceDay;

    /**
     * 浮动率或价差率(%)
     */
    @NotNull(message = "请输入浮动率或价差率(%)")
    private Double rate;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 修改人
     */
    private String updator;

    /**
     * 调整价格类型(0:按合同价1:按基准价2:按对比价,CalcAdjustTypeEnum)
     */
    private Integer calcAdjustType;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    public SaleStrengthAdjustPrice(){}
    public SaleStrengthAdjustPrice(@NotNull(message = "请选择公司") Long orgId, @NotNull(message = "请选择合同") Long contractId, Long strengthId, @NotNull(message = "请选择强度等级") String strength, Date takeTime, @NotNull(message = "请输入单价") Double price, @NotNull(message = "请输入含税单价") Double taxPrice, Integer type, Integer status, String remark, String creator, Date createTime) {
        this.orgId = orgId;
        this.contractId = contractId;
        this.strengthId = strengthId;
        this.strength = strength;
        this.takeTime = takeTime;
        this.price = price;
        this.taxPrice = taxPrice;
        this.status = status;
        this.remark = remark;
        this.creator = creator;
        this.createTime = createTime;
        this.type = type;
    }

    public SaleStrengthAdjustPrice(@NotNull(message = "请选择公司") Long orgId, @NotNull(message = "请选择合同") Long contractId, Long strengthId, @NotNull(message = "请选择强度等级") String strength, Date takeTime, @NotNull(message = "请输入单价") Double price, @NotNull(message = "请输入含税单价") Double taxPrice, Integer type, Integer status, String remark, @NotNull(message = "请输入基准价类型") Integer basisPriceType, String priceDay, @NotNull(message = "请输入浮动率或价差率(%)") Double rate, String creator, Date createTime) {
        this.orgId = orgId;
        this.contractId = contractId;
        this.strengthId = strengthId;
        this.strength = strength;
        this.takeTime = takeTime;
        this.price = price;
        this.taxPrice = taxPrice;
        this.type = type;
        this.status = status;
        this.remark = remark;
        this.basisPriceType = basisPriceType;
        this.priceDay = priceDay;
        this.rate = rate;
        this.creator = creator;
        this.createTime = createTime;
    }
}
